﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using _18miljard.Db;
using System.Xml;

namespace _18miljard.Daily
{
	internal class DeleteOldMails : DailyJob
	{
		public DeleteOldMails(XmlNode jobNode)
			: base(jobNode, "Deleting old mails...")
		{ }

		public override void Execute()
		{
			this.OnStart();

			try
			{
				Query query = new Query("sp_deleteoldmails");

				query.Execute();
			}
			catch (Exception e)
			{
				this.OnError(e);
			}

			this.OnEnd();
		}
	}
}
